package com.yz.lzq.liwushuo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by AdminJia on 2016/11/28.
 */

public class CategoryAdapter extends FragmentPagerAdapter {
    private String[] arrTitles = null;
    private List<Fragment> mlist = null;

    public CategoryAdapter(FragmentManager fm, String[] arrTitles, List<Fragment> mlist) {
        super(fm);
        this.arrTitles = arrTitles;
        this.mlist = mlist;
    }

    @Override
    public Fragment getItem(int position) {
        return mlist.get(position);
    }

    @Override
    public int getCount() {
        return mlist.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return arrTitles[position];
    }
}
